package com.fzk.blog.settings.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fzk.blog.bean.User;
import com.fzk.blog.bean.vo.UserInfo;

import java.util.List;
import java.util.Map;

/**
 * @author fzk
 * @date 2021-08-15 16:41
 */
public interface IUserService {
    Map<String,Object> doLogin(String phone, String password) throws JsonProcessingException;

    UserInfo getMyInfo(int loginId) throws JsonProcessingException;

    Map<String, Object> doRegister(String phone, String email, String password, String code, int roleId) throws JsonProcessingException;

    Map<String,Object> updateMyInfo(int loginId, User user);

    List<UserInfo> getUserInfoList() throws JsonProcessingException;

    UserInfo getUserInfoById(int id) throws JsonProcessingException;

    Map<String, Object> getUserInfoListPage(String phone, String username, int blogNumberMin, int blogNumberMax, int index, int pageSize);

    Map<String,Object> insertUser(User user, String password, int loginId) throws JsonProcessingException;

    UserInfo getUserInfoWithPwd(int userId);

    UserInfo updateUser(User user, String password, int loginId);

    int deleteUsers(int[] ids, int loginId);

    void resetPwd(int loginId, String newPassword);

    Map<String,Object> sendCode(String email);

    Map<String,Object> sendCode(String phone, String email);

    Map<String, Object> doForgetPwd(String phone, String email, String password, String code) throws JsonProcessingException;
}
